To perform highly efficient encoding of an image signal, orthogonal transformation is usually used. A conventional image encoding apparatus converts an image signal to a DC component and AC component by transforming the image signal into a frequency domain by dividing an image frame into blocks with a prescribed size of 8×8 pixels, for example, and by applying two-dimensional orthogonal transformation such as DCT (Discrete Cosine Transform) to each block divided.
Then, as shown on page 106 of “MPEG”, one of General Multimedia Selected Books, compiled by The Institute of Television Engineers of Japan, and published by Ohmsha, Apr. 20, 1996, it obtains difference values between the DC component with comparatively large energy and the DC components as predicted values of neighboring blocks, and carries out compression by variable-length encoding of the difference values.
Since the image has spatial correlation, a variable-length code table is set in such a manner as to have short code length when the difference values are small. Thus, when the correlation with the neighboring blocks is strong, the difference values become small, enabling highly efficient encoding. However, when the correlation with the neighboring blocks is weak, the encoding efficiency is decreased.
In addition, to encode the first block of the image frame, it obtains the difference values between the DC component after the orthogonal transformation and a predetermined default value. The default value is determined according to the encoding scheme, and uses a median value 1024 of a range 0-2047 after the orthogonal transformation of the image signal regardless of the input image, thereby decreasing the encoding efficiency as well.
With the foregoing configuration, the conventional image encoding apparatus has a problem of being unable to carry out the highly efficient encoding when encoding the first block or a block with weak correlation with the neighboring blocks.
The present invention is implemented to solve the foregoing problems. Therefore it is an object of the present invention to provide an image encoding apparatus capable of carrying out highly efficient encoding when encoding the first block or a block with weak correlation with neighboring blocks.
Another object of the present invention is to provide an image decoding apparatus capable of decoding an image signal passing through the highly efficient encoding by the image encoding apparatus.